package com.bolt.report.business.modules.datasource.entity;

import com.bolt.support.spring.jpa.entity.PersistableEntity;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * Auto Generate Javadoc
 *
 * @author 日期:2021-11-17 14:15:55
 **/
@Access(AccessType.FIELD)
@Entity
@Table(name = "bolt_report_data_source")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class ReportDataSourceEntity extends PersistableEntity<String> {
    private static final long serialVersionUID = 1L;
    /**
     *
     */
    @Id
    @GeneratedValue(generator = "hibernate-uuid")
    @GenericGenerator(name = "hibernate-uuid", strategy = "org.hibernate.id.UUIDGenerator")
    private String id;

    /**
     * 数据源名称
     */
    @Column(name = "name", length = 100)
    private String name;


    /**
     * 编码
     */
    @Column(name = "code", length = 100)
    private String code;

    /**
     * 备注
     */
    @Column(name = "remark", length = 200)
    private String remark;

    /**
     * 数据库类型
     */
    @Column(name = "db_type", length = 10)
    private String dbType;

    /**
     * 驱动类
     */
    @Column(name = "db_driver", length = 100)
    private String dbDriver;

    /**
     * 数据源地址
     */
    @Column(name = "db_url", length = 500)
    private String dbUrl;

    /**
     * 用户名
     */
    @Column(name = "db_username", length = 100)
    private String dbUsername;

    /**
     * 密码
     */
    @Column(name = "db_password", length = 100)
    private String dbPassword;

    /**
     * 连接失败次数
     */
    @Column(name = "connect_times", length = 10)
    private Integer connectTimes;


}